<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title> new document </title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<!--   引入jQuery -->
	<script src="../../scripts/jquery-1.3.1.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function(){
			var $id_a  = $('#id.a');//jQuery对象
			var $id_b  = $('#id#b');//jQuery对象
			var $id_c =  $('#id[1]'); 	//jQuery对象
			alert( $id_a.html() );//这样会获取不到，输出null
			alert( $id_b.html() );//这样会获取不到，输出null
			alert( $id_c.html() );//这样会获取不到，输出null

			var $id_right_a  = $('#id\\.a');//jQuery对象,对特殊字符,我们转义一下
			var $id_right_b  = $('#id\\#b');//jQuery对象,对特殊字符,我们转义一下
			var $id_right_c  = $('#id\\[1\\]'); 			//对特殊字符，我们转义一下
			alert( $id_right_a.html() );//正确输出"aa"
			alert( $id_right_b.html() );//正确输出"bb"
			alert( $id_right_c.html() );//正确输出"cc"
		})
	</script>
</head>
<body>
	<div id="id.a">aa</div>
	<div id="id#b">bb</div>
	<div id="id[1]">cc</div>
</body>
</html>
